{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<div style="padding:30px 0;height:30px;">
    <h1 style="line-height:30px;float:left;font-size:18px;margin:10px 10px;padding:0;"> 修改代理返点</h1>
  </div>
  
  <form action="" enctype="multipart/form-data" method="post" class="form form-horizontal" id="form-article-add">
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">代理活跃人数</label>
      <div class="formControls col-xs-8 col-sm-9">
      
        <input id="name" type="text" style="width:205px;" name="num" required value="{$class.num}" class="input-text"/>
      </div>
    </div>
    <input type="hidden" style="width:205px;" name="id" required value="{$uid}" class="input-text"/>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">一级下线百分比：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input id="fsbl" type="text" style="width:205px;" name="one_yj" value="{$class.one_yj}" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">%
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">二级下线百分比：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" style="width:205px;" name="two_yj" value="{$class.two_yj}" class="input-text" onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">%
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2">三级下线百分比：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input id="czzsbl" type="text" style="width:205px;" name="tree_yj" value="{$class.tree_yj}" class="input-text"  onkeyup="clearNoNum(this)" onafterpaste="clearNoNum(this)">%
      </div>
    </div>
    <div class="am-margin" style="margin-top:60px;">
  		<input type="submit" style="margin-left:170px;" class="btn btn-danger radius"  value="提交保存" />
  		<input type="button" onclick="javascript:history.go(-1);" style="margin-left:30px;" class="btn btn-primary radius"  value="关闭" />
  </div>
          
  </form>
  <div>
    
  </div>
{/block} 

{block name="js"}
<script>
  function clearNoNum(obj){
    obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符
    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数
    if( obj.value.indexOf(".")< 0 && obj.value !="" ){
      obj.value= parseFloat(obj.value);
    }

  }
</script>


{/block}

